<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>中心通过方案</title>
<link rel="stylesheet" type="text/css" href="../css/blueprint/screen.css" media="screen, projection"/>
<link rel="stylesheet" type="text/css" href="../css/blueprint/plugins/buttons/screen.css" media="screen, projection"/>
<link type="text/css" href="../css/redmond/jquery-ui-1.7.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../script/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../script/jquery-ui-1.7.custom.min.js"></script>
<script type="text/javascript" src="../script/jquery.plugin.tablecross-0.1.js"></script>
<script type="text/javascript" src="../script/jquery.plugin.pageit-0.1.js"></script>
<script type="text/javascript" src="../script/jquery.plugin.ajaxtip-0.1.js"></script>
<script type="text/javascript">
	var planId;
	var xzHtml = "";
	var kzHtml = "";
	var queryVO = {unit: "", xzCode: "", kzCode: "", orderType: "Prj_PSSJ desc"};
	$(document).ready(function() {
		$("#planDataTable").ajaxProccessTip();
		getPlanData(queryVO, 1, 10);
		$("#pageBar").pageListener(getPlanData, queryVO);
		$(".sort-head").sortListener(getPlanData, queryVO, "../images/arrow_up.png", "../images/arrow_down.png");
		$("#QUERY_SELECT").change(function() {
	    	if ($(this).val() == "unit") {
	        	$("#QUERY_TD").html('<input type="text" value="" id="QUERY_CONDITION" />');
	    	}
	    	if ($(this).val() == "xz") {
	        	if (xzHtml == "") {
	        		$.getJSON("InitPlanXmxz.action", function(data) {
	        			var strArr = new Array();
	        			strArr.push('<select id="QUERY_CONDITION">');
	        			strArr.push('<option value="" selected>选择项目性质</option>');
	                    for (var l = 0; l < data.xmxzList.length; l++) {
	                    	strArr.push('<option value="' + data.xmxzList[l].xmxzCode + '">' + data.xmxzList[l].xmxzName + '</option>');
	                    }
	                    strArr.push('</select>');
	                    xzHtml = strArr.join('');
	                    $("#QUERY_TD").html(xzHtml);
	        		});
	        	} else {
	        		$("#QUERY_TD").html(xzHtml);
	        	}
	    	}
	    	if ($(this).val() == "kz") {
	        	if (kzHtml == "") {
	        		$.getJSON("InitPlanKz.action", function(data) {
	        			var strArr = new Array();
	        			strArr.push('<select id="QUERY_CONDITION">');
	        			strArr.push('<option value="" selected>选择矿种</option>');
	                    for (var l = 0; l < data.kzList.length; l++) {
	                    	strArr.push('<option value="' + data.kzList[l].kzCode + '">' + data.kzList[l].kzName + '</option>');
	                    }
	                    strArr.push('</select>');
	                    kzHtml = strArr.join('');
	                    $("#QUERY_TD").html(kzHtml);
	        		});
	        	} else {
	        		$("#QUERY_TD").html(kzHtml);
	        	}
	    	}
		});
		$("#QUERY_BUTTON").click(function() {
			var select = $("#QUERY_SELECT").val();
			var condition = $("#QUERY_CONDITION").val();
			if (select == "unit") {
				queryVO.unit = condition;
				queryVO.xzCode = "";
				queryVO.kzCode = "";
			}
			if (select == "xz") {
				queryVO.unit = "";
				queryVO.xzCode = condition;
				queryVO.kzCode = "";
			}
			if (select == "kz") {
				queryVO.unit = "";
				queryVO.xzCode = "";
				queryVO.kzCode = condition;
			}
			getPlanData(queryVO, 1, 10);
		});
	});

    function getPlanData(queryVO, pageIndex, pageSize) {
    	$.ajax({
            type: "post",
            url: "ListJudgePassedPlan.action",
            data: {"queryVO.unit": queryVO.unit, "queryVO.xzCode": queryVO.xzCode, "queryVO.kzCode": queryVO.kzCode, "pageVO.pageIndex": pageIndex, "pageVO.pageSize": pageSize, "queryVO.orderType": queryVO.orderType},
            dataType: "json",
            success: function(data) {
            	if (data == null) {
                    alert('非法的请求，请确认你是否有权限执行该操作，请重新登录。');
                    window.parent.location.href="../j_spring_security_logout";
                    return;
                }
            	var strArr = new Array();
                for (var i = 0; i < data.planList.length; i++) {
                    strArr.push('<tr>');
                    strArr.push('<td>' + data.planList[i].registerid + '</td>');//项目登记号
                    strArr.push('<td>' + data.planList[i].prjUnit + '</td>');//项目单位
                    strArr.push('<td>' + data.planList[i].prjName + '</td>');//项目名称
                    strArr.push('<td>' + data.planList[i].prjXmxzName + '</td>');//项目性质
                    strArr.push('<td>' + data.planList[i].prjXmgm + '</td>');//项目规模
                    strArr.push('<td>' + data.planList[i].prjKzName + '</td>');//矿种
                    strArr.push('<td>' + data.planList[i].prjScztName + '</td>');//审查状态 
                    strArr.push('<td>' + (data.planList[i].prjPsjgName != null ? data.planList[i].prjPsjgName : "") + '</td>');//评审结果
                    strArr.push('<td>' + data.planList[i].prjPssj + '</td>');//评审时间  
                    strArr.push('<td>' + '<a href="JudgedPlanDetailPre.action?planId=' + data.planList[i].prjPkid + '" target="MainFrame" class="button"><img src="../css/blueprint/plugins/buttons/icons/table.png" alt=""/>明细</a> ');
                    strArr.push('<a href="JudgedPlanResultPre.action?planId=' + data.planList[i].prjPkid + '" target="MainFrame" class="button"><img src="../css/blueprint/plugins/buttons/icons/user_comment.png" alt=""/>查看评审意见</a>');//操作
                    strArr.push('</td></tr>');
                }
                $("#planDataBody").html(strArr.join(''));
                $("#planDataBody").tablecross('', 'odd', 'over');
                $("#pageBar").pageRender(data.pageVO.pageIndex, data.pageVO.pageSize, data.pageVO.pageNum);
            }
    	});
    }
</script>
<style type="text/css">
tr.odd td {
    background: #ecf6fc;
}
</style>
</head>
<body>
<table style="margin-bottom: 10px" width="98%" align="center" cellpadding="0" cellspacing="0">
	<tr>
        <td width="15" style="padding: 0px" align="left">
		    <select id="QUERY_SELECT">
		        <option value="unit">项目单位</option>
		        <option value="xz">项目性质</option>
		        <option value="kz">矿种</option>
		    </select></td>
    	<td width="15" id="QUERY_TD"><input type="text" value="" id="QUERY_CONDITION"/></td>
    	<td align="left"><button type="button" id="QUERY_BUTTON"><img src="../css/blueprint/plugins/buttons/icons/magnifier.png" alt=""/>查询</button></td>
    </tr>
</table>
<table id="planDataTable" class="tablesorter" style="margin-top: 0px" width="98%" align="center" cellpadding="2" cellspacing="2">
    <thead>
        <tr>
            <th width="8%">项目<br/>登记号</th>
            <th width="10%">项目单位</th>
            <th width="10%">项目名称</th>
            <th width="6%">项目<br/>性质</th>
            <th width="6%" class="sort-head" column="Prj_XMGM">项目<br/>规模</th>
            <th width="6%">矿种</th>
            <th width="6%" class="sort-head" column="Prj_SCZTCode">审查<br/>状态</th>
            <th width="6%">评审<br/>结果</th>
            <th width="6%" class="sort-head" column="Prj_PSSJ">评审<br/>时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody id="planDataBody">
    </tbody>
    <tbody id="pageBar">
        <tr>
            <td colspan="10" nowrap="nowrap" width="100%">
                <table>
                    <tbody>
                        <tr>
                            <td height="25"><button type="button" class="first-page"><img src="../css/blueprint/plugins/buttons/icons/resultset_first.png" alt=""/></button></td>
                            <td><button type="button" class="previous-page"><img src="../css/blueprint/plugins/buttons/icons/resultset_previous.png" alt=""/></button></td>
                            <td width="20%"><span class="page-index-selector" style=""></span></td>
                            <td><button type="button" class="next-page"><img src="../css/blueprint/plugins/buttons/icons/resultset_next.png" alt=""/></button></td>
                            <td><button type="button" class="last-page"><img src="../css/blueprint/plugins/buttons/icons/resultset_last.png" alt=""/></button></td>
                            <td><select class="page-size-selector">
                                    <option value="10" selected="selected">10</option>
                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                </select></td>
                            <td width="80%">&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>
</body>
</html>